#!/bin/bash

cd backups
mkdir files
mkdir upload

mysqldump -hvega.mtw.ru -useadesign2 -p6U6keLu0 --character-sets-dir="C:\Program Files\MySQL\MySQL Server 5.1\share\charsets" --default-character-set=cp1251 db_seadesign2 > dump.sql

ftp -n -i vega.mtw.ru <<!
	QUOTE USER seadesign
	QUOTE PASS puspuspus
	binary
	cd html
	lcd files
    mget files/*
	lcd upload
	mget upload/*
	bye
!

tar -czf seadesign_`date +%Y%m%d`.tgz dump.sql files upload

rm dump.sql
rm -r files
rm -r upload